package com.ad.platform.api.feign;

import com.ad.payload.dto.PfCategoryDto;
import com.ad.payload.dto.trade.TradeSubAddDto;
import com.ad.payload.dto.trade.TradeSubDto;
import com.ad.payload.dto.trade.TradeSubEditDto;
import com.ad.payload.model.IdDto;
import com.ad.payload.model.PageDto;
import com.ad.payload.model.PageView;
import com.ad.payload.model.ResultBean;
import com.ad.payload.vo.PfCategoryVo;
import com.ad.payload.vo.trade.ParentCategoryVo;
import com.ad.payload.vo.trade.TradeVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;
import java.util.List;

/**
 * @author:dxgong
 * @日期 2021/3/17 07:40
 * @注释
 */
@FeignClient(value = "platform-service")
@RequestMapping("/pfCategory")
public interface CategoryRemote {

    @RequestMapping(value = "/noAuth/saveOrUpdatePfCategory", method = RequestMethod.POST)
    ResultBean<String> saveOrUpdatePfCategory(@RequestBody @Valid PfCategoryDto pfCategoryDto);

    @RequestMapping(value = "/noAuth/deletePfCategory", method = RequestMethod.POST)
    ResultBean<String> deletePfCategory(@RequestBody @Valid IdDto idDto);

    /**
     * 后台web端类别分页,数据量少,不做条件查询
     * @param pageDto
     * @return
     */
    @PostMapping("/noAuth/listPfCategory")
    ResultBean<PageView<PfCategoryVo>> listPfCategory(@RequestBody PageDto pageDto);


    /**
     * 根据行业id查询子行业列表
     *
     * @param tradeSubDto
     * */
    @PostMapping("/noAuth/pageListSubTradeVo")
    ResultBean<PageView<TradeVo>> pageListSubTradeVo(@RequestBody @Valid TradeSubDto tradeSubDto);



    /**
     * 添加子行业
     *
     * @param tradeSubAddDto
     * */
    @PostMapping("/noAuth/addSubTrade")
    ResultBean<Long> addSubTrade(@RequestBody @Valid TradeSubAddDto tradeSubAddDto);


    /**
     * 编辑子行业
     *
     * @param tradeSubEditDto
     * */
    @PostMapping("/noAuth/editSubTrade")
    ResultBean<Long> editSubTrade(@RequestBody @Valid TradeSubEditDto tradeSubEditDto);



    /**
     * 删除子行业
     *
     * @param idDto
     * */
    @PostMapping("/noAuth/deleteSubTrade")
    ResultBean<Long> deleteSubTrade(@RequestBody @Valid IdDto idDto);


    /**
     * 查询子行业中所有一级行业
     *
     * @param idDto 存放当前行业的主键id
     * */
    @PostMapping("/noAuth/queryParentCategoryVo")
    ResultBean<List<ParentCategoryVo>> queryParentCategoryVo(@RequestBody @Valid IdDto idDto);



}
